#include <iostream>
#include <vector>

using namespace std;

class Solution {
   public:
    int search(vector<int>& nums, int target) {
        int left = -1;
        int right = nums.size();
        int mid;
        while (left < right - 1) {
            mid = (left + right) >> 1;
            if (nums[mid] < target) {
                left = mid;
            } else {
                right = mid;
            }
        }
        int ans1 = right;
        left = -1;
        right = nums.size();
        mid;
        while (left < right - 1) {
            mid = (left + right) >> 1;
            if (nums[mid] <= target) {
                left = mid;
            } else {
                right = mid;
            }
        }
        int ans2 = right;
        return ans2 - ans1;
    }
};
int main() {
    return 0;
}
